﻿using OctoOS.UI;
using System.Web.UI.HtmlControls;
using System;
using System.Web;

/// <summary>
/// Summary description for PageUIPreview
/// </summary>
public class PageUIPreview : ObjectPreview
{
	public PageUIPreview(long articleID, Page page)
	{
		HeaderText = page.Title == "" ? "page" : page.Title;
		HeaderUrl = Urls.GetEditPage(articleID, page.ID);
		var link = new HtmlAnchor()
			{
				ID = articleID + "_" + page.ID + "_" + HttpUtility.JavaScriptStringEncode(page.Title),
				InnerText = Resources.Main.shared_Delete
			};
		link.Attributes.Add("class", "deletePageLink");
		Footer = link;
		Body = new Literal(Resources.Main.shared_Status + ": " + page.Status);
	}
}